<?php
error_reporting(E_ALL ^ E_NOTICE);
session_start();
$connect = mysql_connect('localhost','root','');
mysql_select_db("admintool");
?>
<?php
if($_SESSION["loggedin"]==true && $_SESSION["role"]==admin)
{
if(isset($_SESSION[msg]))
{
echo $_SESSION[msg];
unset($_SESSION[msg]);
}
?>

<?php
$selectadmin = "SELECT * from allocation";
$admincheck = mysql_query($selectadmin);
?>
<table border="1" cellspacing="0">
<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
<td><a href="add.php" >Add</a></td></tr>
<tr>
<td>Project Name</td>

<td>Employee Name</td>

</tr>
<?php
while($adminform = mysql_fetch_array($admincheck))
//print_r($adminform);
{
?><tr><td>
<?php
echo $adminform['projectname'].'<br>';
?></td><td>
<?php
echo $adminform['empname'].'<br>';
?></td>
<td><a href="edit.php?id=<?php echo $adminform['alloid']; ?>">Edit</a>
<a href="delete.php?id=<?php echo $adminform['alloid']; ?>">Delete</a>
</td>
<?php
?></tr>
<?php

}

?>

</table>
<?php 

?>
<?php
}
else
{
header("Location: login.php");
}
?>